package com.hd.manager.shiro.filter;


import com.hd.manager.shiro.ShiroUtils;
import com.hd.hdxgddcommon.constant.ResultConst;
import com.hd.hdxgddcommon.entity.dto.ResultDto;
import org.apache.shiro.web.filter.authz.PermissionsAuthorizationFilter;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;


/**
 * <p>
 * 自定义授权过滤器
 * </p>
 *
 * @author Administrator
 * @since 2018-10-30
 */
public class CustomRootFilter extends PermissionsAuthorizationFilter {

    @Override
    protected boolean onAccessDenied(ServletRequest request, ServletResponse response) {
        ShiroUtils.responseJson(response, new ResultDto(ResultConst.UN_ROOT.getCode(), ResultConst.UN_ROOT.getMsg()));
        return false;
    }

}
